<template>
    <div class="salesOrder">
        <!-- 表单 -->
        <div class="formSearch">
            <div class='searchContent'>
                <el-form :model="form" label-width="80px" size="mini">
                    <el-form-item label="单据编号" style='width:33%'>
                        <el-input v-model="form.code" placeholder="请输入单据编号"></el-input>
                    </el-form-item>
                </el-form>

                <div class="btn" style="flex:2;padding-left:20px">
                    <div style="display:flex">
                        <el-button type="primary" icon="el-icon-search" size="mini" @click="search">查询</el-button>
                    </div>
                </div>
            </div>
        </div>

        <!-- 按钮操作 -->
        <custom-setbtn>
            <template #l_btn>
                <div class="l_btn">
                    <el-button type="primary" size="mini" icon="el-icon-circle-plus-outline"
                        @click="$router.push('/productionManagement/salesOrder/create')">创建销售订单</el-button>
                </div>
            </template>
        </custom-setbtn>

        <!-- 表格 -->
        <table-list ref='tableList' :searchForm='form'></table-list>
    </div>
</template>

<script>
    import tableList from './tableList.vue'
    export default {
        data() {
            return {
                form: {
                    code: '',
                    type:0,
                    page:1,
                    limit:10
                }
            }
        },
        components: {
            tableList
        },
        mounted() {

        },
        methods: {
            //查询
            search(){
                this.form.page = 1
                this.$refs.tableList.getFormList(this.form)
            }
        },
    }
</script>

<style lang="less" scoped>
    .salesOrder {
        overflow: auto;

        .formSearch {
            position: relative;
            padding: 20px 20px 0;

            .searchContent {
                border-bottom: 1px solid #e8e8e8;
                display: flex;

                .el-form {
                    display: flex;
                    flex-wrap: wrap;
                    flex: 22;
                }

                .btn {
                    >div {
                        justify-content: center;
                    }
                }
            }

            /deep/ .el-form-item__label {
                font-size: 12px;
                color: rgba(0, 0, 0, .85);
            }
        }
    }
</style>